<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="layout/blank"><!-- layout文件路径-->
<head>
    <title>编辑Level</title>
</head>
<body>
<div layout:fragment="content">
    <div class="content-frame">
        <div class="content-frame-right">
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">上传资料</h3>
                            <ul class="panel-controls">
                                <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                            </ul>
                        </div>

                        <div class="panel-body">
                            <h4>上传封面:</h4>
                            <div class="block push-up-10">
                                <form id="coverForm" class="dropzone dropzone-mini dz-clickable">
                                    <div class="dz-default dz-message"><span>上传截图</span></div>
                                </form>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-frame-body content-frame-body-left">

            <div class="row">
                <div class="col-md-12">

                    <form class="form-horizontal" id="levelForm" >
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title" th:if="${isEdit} eq 'add'">新增Level</h3>
                                <h3 class="panel-title" th:if="${isEdit} eq 'edit'">编辑Level</h3>
                                <ul class="panel-controls">
                                    <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                                </ul>
                            </div>

                            <div class="panel-body">

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">课程名称</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="text" class="form-control" name="title"
                                                   th:if="${isEdit} eq 'add'"/>
                                            <input type="text" class="form-control" name="title"
                                                   th:value="${memberCard.title}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">填写课程名称，必填</span>
                                    </div>
                                </div>
                                <input type="hidden" name="id" th:if="${isEdit} eq 'add'"/>
                                <input type="hidden" name="id" th:value="${memberCard.id}" th:if="${isEdit} eq 'edit'"/>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">副标题</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="text" class="form-control" name="subtitle"
                                                   th:if="${isEdit} eq 'add'"/>
                                            <input type="text" class="form-control" name="subtitle"
                                                   th:value="${memberCard.subtitle}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">填写课程副标题，必填</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">封面</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="text" class="form-control" required name="cover" id="coverInput" th:if="${isEdit} eq 'add'"/>
                                            <input type="text" class="form-control" required name="cover" id="coverInput" th:value="${memberCard.cover}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">右侧上传封面，必填</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">类型</label>
                                    <div class="col-md-6 col-xs-12">
                                        <select class="form-control select" name="type" th:if="${isEdit} eq 'add'">
                                            <option th:each="levelType:${types}" th:value="${levelType.type}"
                                                    th:text="${levelType.name}"></option>
                                        </select>
                                        <select class="form-control select" name="type" th:if="${isEdit} eq 'edit'">
                                            <option th:each="levelType:${types}" th:value="${levelType.type}"
                                                    th:text="${levelType.name}"
                                                    th:selected="${levelType.type==memberCard.type}"></option>
                                        </select>
                                        <span class="help-block">请选择课程类型，必填</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">是否免费公开课</label>
                                    <div class="col-md-6 col-xs-12">
                                        <select class="form-control select" name="free">
                                            <option th:value="0" th:selected="${memberCard.free=='0'}"
                                                    th:text="免费公开课"></option>
                                            <option th:value="1" th:selected="${memberCard.free=='1'}" th:text="付费课"></option>
                                        </select>
                                        <span class="help-block">选择课程属性，必填</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">价格</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-cny"></span></span>
                                            <input type="" class="form-control" required="true" min="0" value="0" max="10000"
                                                   name="price" step="0.01" th:if="${isEdit} eq 'add'"/>
                                            <input type="" class="form-control" required="true" min="0" max="10000"
                                                   name="price" step="0.01" th:value="${memberCard.price}"
                                                   th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">这里填写销售价格</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">原价</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-cny"></span></span>
                                            <input type="" class="form-control" required="true" min="0" max="10000" value="0"
                                                   name="originalPrice" step="0.01" th:if="${isEdit} eq 'add'"/>
                                            <input type="" class="form-control" required="true" min="0" max="10000"
                                                   name="originalPrice" step="0.01" th:value="${memberCard.originalPrice}"
                                                   th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">这里填写原价格</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">返现比例</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-cny"></span></span>
                                            <input type="" class="form-control" required="true" min="0" max="100" value="0"
                                                   name="rate" step="1" th:if="${isEdit} eq 'add'"/>
                                            <input type="" class="form-control" required="true" min="0" max="100"
                                                   name="rate" step="1" th:value="${memberCard.rate}"
                                                   th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">这里填写返现比例（整数例如 30，代表 30%返现给用户）</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">邀请免费</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-cny"></span></span>
                                            <input type="" class="form-control" required="true" min="0" value="0" name="assistNumber"
                                                   step="1" th:if="${isEdit} eq 'add'"/>
                                            <input type="" class="form-control" required="true" min="0" name="assistNumber"
                                                   step="1" th:value="${memberCard.assistNumber}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">这里填写邀请多少人可以免费解锁课程（默认值为0,价格不受影响。）</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">初始访问量</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-cny"></span></span>
                                            <input type="" class="form-control" required="true" min="0" value="100" name="viewCount"
                                                   step="1" th:if="${isEdit} eq 'add'"/>
                                            <input type="" class="form-control" required="true" min="0" name="viewCount"
                                                   step="1" th:value="${memberCard.viewCount}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">这里填写初始访问量（默认值为100）</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">是否邮寄物品</label>
                                    <div class="col-md-6 col-xs-12">
                                        <select class="form-control select" name="express">
                                            <option th:value="0" th:selected="${memberCard.express=='0'}" th:text="否"></option>
                                            <option th:value="1" th:selected="${memberCard.express=='1'}" th:text="是"></option>
                                        </select>
                                        <span class="help-block">选择课程属性，必填</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">详细介绍</label>
                                    <div class="col-md-6 col-xs-12">
                                        <textarea class="summernote"></textarea>
                                        <input type="hidden" name="content" id="content" th:value="${memberCard.content}"></input>
                                    </div>
                                </div>
                            </div>
                            <div class="panel-footer">
                                <a class="btn btn-primary pull-right" id="submit-memberCard-form-btn">提交</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>
